package com.mall.server.service;

import com.mall.dubbo.api.PmsSkuStockApi;
import com.tanhua.model.domain.PmsSkuStock;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SkuService {

    @DubboReference
    private PmsSkuStockApi pmsSkuStockApi;
    /**
     * 根据商品ID及sku编码模糊搜索sku库存
     * @param pid
     * @param keyword
     * @return
     */
    public List<PmsSkuStock> findByPid(Long pid, String keyword) {
        return pmsSkuStockApi.findByPid(pid,keyword);
    }

    /**
     * 批量更新sku库存信息
     * @param pid
     * @param skuStockList
     * @return
     */
    public void updateByPid(Long pid, List<PmsSkuStock> skuStockList) {
        pmsSkuStockApi.updateByPid(pid,skuStockList);
    }
}
